const std = @import("std");
const utils = @import("../utils.zig");
const setting = @import("../setting.zig");
const math = std.math;
const Cell = @import("../cell.zig");

const Force = @This();

cell: *Cell,

damage: f32,

pub fn init(cell: *Cell) @This() {
    return .{
        .cell = cell,
        .damage = @floatFromInt(cell.rand.intRangeAtMost(u32, 1, 360)),
    };
}

pub fn deinit(self: *@This()) void {
    _ = self;
}

pub fn fight(self: *@This(), enemy: *Cell) void {
    if (self.damage > enemy.force.damage) {
        enemy.alive = false;
    } else if (self.damage < enemy.force.damage) {
        self.cell.alive = false;
    }
}
